package cn.itsource.ymcc.openfeign.fallback;

import cn.itsource.ymcc.common.result.JsonResult;
import cn.itsource.ymcc.domain.Login;
import cn.itsource.ymcc.openfeign.LoginFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginFeignClientFallbackFactory implements FallbackFactory<LoginFeignClient> {
    @Override
    public LoginFeignClient create(Throwable throwable) {
        return new LoginFeignClient() {
            @Override
            public JsonResult saveOrUpdate(Login login) {
                return JsonResult.error("saveOrUpdate调用失败！");
            }
        };
    }
}
